<?php
/**
 * 公出时间覆盖
 */
apf_require_class('Oa_Test_AbstractTest');
apf_require_class('Bll_Attendance_AccessDayRecord');
class Oa_Test_Util_DayStatusTest extends Oa_Test_AbstractTest {
    public function setUp(){
    }
    public function tearDown(){

    }

    /**
     * 打卡记录
     * @dataProvider data_access_record
     */
    public function testDayAccessRecord($params,$result){
        $bll = new Bll_Attendance_AccessDayRecord();
        $day=$params[0];
        $start_work=$params[1];
        $end_work=$params[2];
        $data = $bll->check_day_work_status($day,$start_work,$end_work);
        $this->assertEquals($data,$result);
    }
    private $access_data = array();
    /**
     * 打卡记录
     *
     */
    public function data_access_record(){
        return array(
                array(array(20120901,200,1800),array(5,6),"正常"),

                array(array(20120901,910,910),array(5,4),"下午缺勤"),
                array(array(20120901,910,911),array(5,4),"下午缺勤"),
                array(array(20120901,910,931),array(5,4),"下午缺勤"),
                array(array(20120901,910,1401),array(5,4),"下午缺勤"),
                array(array(20120901,910,1411),array(5,4),"下午缺勤"),
                array(array(20120901,910,1431),array(5,4),"下午缺勤"),
                array(array(20120901,910,1730),array(5,2),"早退"),
                array(array(20120901,910,1800),array(5,6),"正常"),

                array(array(20120901,911,912),array(1,4),"迟到,下午缺勤"),
                array(array(20120901,911,931),array(1,4),"迟到,下午缺勤"),
                array(array(20120901,911,1401),array(1,4),"迟到,下午缺勤"),
                array(array(20120901,911,1411),array(1,4),"迟到,下午缺勤"),
                array(array(20120901,911,1431),array(1,4),"迟到,下午缺勤"),
                array(array(20120901,911,1730),array(1,2),"迟到,下午缺勤"),
                array(array(20120901,911,1830),array(1,6),"迟到,下午缺勤"),

                array(array(20120901,931,931),array(3,4),"全天缺勤"),
                array(array(20120901,931,1401),array(3,4),"全天缺勤"),
                array(array(20120901,931,1411),array(3,4),"全天缺勤"),
                array(array(20120901,931,1431),array(3,4),"全天缺勤"),
                array(array(20120901,931,1730),array(3,2),"上午缺勤,早退"),
                array(array(20120901,931,1800),array(3,6),"上午缺勤"),

                array(array(20120901,1401,1410),array(3,4),"全天缺勤"),
                array(array(20120901,1401,1411),array(3,4),"全天缺勤"),
                array(array(20120901,1401,1431),array(3,4),"全天缺勤"),
                array(array(20120901,1401,1730),array(3,2),"上午缺勤,早退"),
                array(array(20120901,1401,1800),array(3,6),"上午缺勤"),

                array(array(20120901,1411,1411),array(3,4),"全天缺勤"),
                array(array(20120901,1411,1431),array(3,4),"全天缺勤"),
                array(array(20120901,1411,1730),array(3,2),"上午缺勤,早退"),
                array(array(20120901,1411,1800),array(3,6),"上午缺勤"),

                array(array(20120901,1431,1431),array(3,4),"全天缺勤"),
                array(array(20120901,1431,1730),array(3,2),"上午缺勤,早退"),
                array(array(20120901,1431,1800),array(3,6),"上午缺勤"),

                array(array(20120901,1800,1800),array(3,4),"全天缺勤"),

                //特殊上下班时间
                array(array(20120929,900,1500),array(5,4),"下午缺勤"),
                array(array(20120929,900,1600),array(5,6),"正常"),
                array(array(20120929,900,1700),array(5,6),"正常"),

                array(array(20120929,911,1500),array(1,4),"迟到,下午缺勤"),
                array(array(20120929,911,1600),array(1,6),"迟到"),

                array(array(20120929,931,1500),array(3,4),"上午缺勤,下午缺勤"),
                array(array(20120929,931,1600),array(3,6),"上午缺勤"),

                array(array(20120929,1000,1500),array(3,4),"上午缺勤,下午缺勤"),
                array(array(20120929,1000,1600),array(3,6),"上午缺勤"),

                array(array(20120929,1411,1500),array(3,4),"上午缺勤,下午缺勤"),
                array(array(20120929,1411,1600),array(3,6),"上午缺勤"),

                array(array(20120929,1431,1500),array(3,4),"上午缺勤,下午缺勤"),
                array(array(20120929,1431,1600),array(3,6),"上午缺勤"),
        );
    }
    /**
     * 特殊上下班时间 20120929 900 1600
     */
    public function data_special_work_time(){
        return array(
                array(array(20120929,900,1500),array(5,4),"下午缺勤"),
                array(array(20120929,900,1600),array(5,6),"正常"),
                array(array(20120929,900,1700),array(5,6),"正常"),

                array(array(20120929,911,1500),array(1,4),"迟到,下午缺勤"),
                array(array(20120929,911,1600),array(1,6),"迟到"),

                array(array(20120929,931,1500),array(3,4),"上午缺勤,下午缺勤"),
                array(array(20120929,931,1600),array(3,4),"上午缺勤"),

                array(array(20120929,1000,1500),array(5,4),"上午缺勤,下午缺勤"),
                array(array(20120929,1000,1600),array(5,4),"上午缺勤"),

                array(array(20120929,1411,1500),array(5,4),"上午缺勤,下午缺勤"),
                array(array(20120929,1411,1600),array(5,4),"上午缺勤"),

                array(array(20120929,1431,1500),array(5,4),"上午缺勤,下午缺勤"),
                array(array(20120929,1431,1600),array(5,4),"上午缺勤"),
        );
    }
    /**
     * 公出时间
     */
    public function data_gongchu(){
        return array();
    }

}